const app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    array:
      [
      {
        "id": 1,
        "imageUrl": "http://pic8.photophoto.cn/20080813/0035036019860667_b.jpg",
        "imageTitle": "家人闲坐，灯火可亲。",
        "imageText": "家人闲坐，灯火可亲",
        "imageDataMonth": "一月",
        "imageDataDay": "14",
        "imageDay": "星期日",
        "textAuthor": "汪曾祺《冬天》（推荐by果儿）"
      },
      {
        "id": 2,
        "imageUrl": "http://pic8.photophoto.cn/20080813/0035036019860667_b.jpg",
        "imageTitle": "一堆小奶猫来袭，心脏已无法承受。",
        "imageText": "生命差点儿不能成其为生命，我们差点儿做不成我们自己。",
        "imageDataMonth": "一月",
        "imageDataDay": "13",
        "imageDay": "星期六",
        "textAuthor": "卡尔维诺"
      },
      {
        "id": 3,
        "imageUrl": "http://pic8.photophoto.cn/20080813/0035036019860667_b.jpg",
        "imageTitle": "不是渐行渐远，而是有一天终要重逢。",
        "imageText": "家人闲坐，灯火可亲",
        "imageDataMonth": "一月",
        "imageDataDay": "12",
        "imageDay": "星期日",
        "textAuthor": "汪曾祺《冬天》（推荐by果儿）"
      },
      {
        "id": 4,
        "imageUrl": "http://pic8.photophoto.cn/20080813/0035036019860667_b.jpg",
        "imageTitle": "家人闲坐，灯火可亲。",
        "imageText": "家人闲坐，灯火可亲",
        "imageDataMonth": "一月",
        "imageDataDay": "11",
        "imageDay": "星期日",
        "textAuthor": "汪曾祺《冬天》（推荐by果儿）"
      },
      {
        "id": 5,
        "imageUrl": "http://pic8.photophoto.cn/20080813/0035036019860667_b.jpg",
        "imageTitle": "家人闲坐，灯火可亲。",
        "imageText": "家人闲坐，灯火可亲",
        "imageDataMonth": "一月",
        "imageDataDay": "14",
        "imageDay": "星期日",
        "textAuthor": "汪曾祺《冬天》（推荐by果儿）"
      },
      {
        "id": 6,
        "imageUrl": "http://pic8.photophoto.cn/20080813/0035036019860667_b.jpg",
        "imageTitle": "一堆小奶猫来袭，心脏已无法承受。",
        "imageText": "生命差点儿不能成其为生命，我们差点儿做不成我们自己。",
        "imageDataMonth": "一月",
        "imageDataDay": "13",
        "imageDay": "星期六",
        "textAuthor": "卡尔维诺"
      },
      {
        "id": 7,
        "imageUrl": "http://pic8.photophoto.cn/20080813/0035036019860667_b.jpg",
        "imageTitle": "不是渐行渐远，而是有一天终要重逢。",
        "imageText": "家人闲坐，灯火可亲",
        "imageDataMonth": "一月",
        "imageDataDay": "12",
        "imageDay": "星期日",
        "textAuthor": "汪曾祺《冬天》（推荐by果儿）"
      },
      ]
  },
  showDetailTap:function(e){
    wx.navigateTo({
      url: '../detail_show/detail_show?id=' + e.currentTarget.dataset.id
    })
    console.log(e.currentTarget.dataset.id)
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    // var that = this//不要漏了这句，很重要
    // wx.request({
    //   url: 'http://127.0.0.1/微信小程序/pages/detail/detail.json',
    //   method: 'POST',
    //   headers: {
    //     'Content-Type': 'application/json'
    //   },
    //   success: function (res) {
    //     //将获取到的json数据，存在名字叫array的这个数组中
    //     that.setData({
    //       array: res.data.data,
    //       //res代表success函数的事件对，data是固定的，stories是是上面json数据中stories

    //     })
    //   }
    // })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
    
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
    
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    
  }
})